home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / util / misc / EasyElements.lha / EasyElements / Source / EEloop.c < prev    next >
Text File  |  1994-12-28  |  757b  |  46 lines

  1.  
  2. mainloop()
  3. {
  4.  
  5.     while (!terminated)
  6.     {
  7.  
  8.     Wait( 1<<EasyElementsWnd->UserPort->mp_SigBit);
  9.  
  10.     while ((!terminated) && (imsg = GT_GetIMsg(EasyElementsWnd->UserPort)))
  11.     {
  12.  
  13.         gad = (struct Gadget *)imsg->IAddress;
  14.         imsgClass = imsg->Class;
  15.         imsgCode = imsg->Code;
  16.  
  17.         GT_ReplyIMsg(imsg);
  18.  
  19.  
  20.         switch (imsgClass)
  21.         {
  22.         case IDCMP_CLOSEWINDOW:
  23.             terminated = TRUE;
  24.             break;
  25.         case IDCMP_REFRESHWINDOW:
  26.             GT_BeginRefresh(EasyElementsWnd);
  27.             GT_EndRefresh(EasyElementsWnd,TRUE);
  28.             break;
  29.         case IDCMP_GADGETUP:
  30.             switch (gad->GadgetID)
  31.             {
  32.  
  33.             case GD_Input:
  34.                 input = (((struct StringInfo *)gad->SpecialInfo)->Buffer);
  35.                 pressed_Input();
  36.                 break;
  37.             }
  38.         default:
  39.             break;
  40.  
  41.         }
  42.     }
  43.     }
  44. }
  45.  
  46.